//import { createRouter, createWebHistory } from 'vue-router';
import { createRouter, createWebHistory,createWebHashHistory } from 'vue-router';

import Enum from "@/js/Enum";
const routes = [

  {
    path: Enum.startPath, //刚进入首页一级页面
    component: () => import('@/views/panel/StartPanel.vue')
  },
  {
    path: Enum.pinPaiJSPath, //品牌介绍一级页面
    component: () => import('@/views/panel/PinPaiJSPanel.vue')
  },
  {
    path: Enum.tesecpPath, //特色产品一级页面
    component: () => import('@/views/panel/TeSeCpPanel.vue')
  },
  {
    path: Enum.mendfcPath, //门店风采一级页面
    component: () => import('@/views/panel/MenDianfsPanel.vue'),
    children: [
      {
        path: Enum.mendfc_list,
        component: () => import('@/views/pages/MenDianListPage')
      },
      {
        path: Enum.mendfc_details,
        component: () => import('@/views/pages/MenDianDetailsPage')
      }
    ]
  },
  {
    path: Enum.hezzxPath, //合作中心一级页面
    component: () => import('@/views/panel/HeZuoZxPanel.vue'),
  },
  {
    path: Enum.ppzixuPath, // 品牌咨询一级页面
    component: () => import('@/views/panel/PPzixuPanel.vue'),
    children: [
      {
        path: Enum.zixu_list,
        component: () => import('@/views/pages/PPzixuListPage')
      },
      {
        path: Enum.zixu_details,
        component: () => import('@/views/pages/PPzixuDetailsPage')
      }
    ]
  },
  {
    path: Enum.lxwomPath, // 联系我们一级页面
    component: () => import('@/views/panel/LxwomenPanel.vue'),
  }
]

const router = createRouter({
  //history: createWebHistory(process.env.BASE_URL),
  history:createWebHashHistory(),
  routes
})
router.beforeEach((to, from, next) => {
 // NProgress.start() // 进度条开始
  next()
})

router.afterEach((to, from) => {
 // NProgress.done() // 进度条结束
})


export default router
